<?php

/**
 * Comment form.
 *
 * @package    IPLIFE
 * @subpackage form
 * @author     alexey.shapran@gmail.com
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class UnregCommentForm extends BaseCommentForm
{
	public function configure()
	{
		$this->setWidgets(array(
  	'body' => new sfWidgetFormTextarea(array(),array('class'=>'questiontext')),
  	'guest_name'  => new sfWidgetFormInputText(array(), array('maxlenght'=>50)),
		/*'captcha' => new sfWidgetFormReCaptcha(array('public_key' => '6Lc2cLsSAAAAAO31GGR8RSboWmXFwX5f8_GWNvVw')),*/
    'entity_id'   => new sfWidgetFormInputHidden(),
    'entity_type' => new sfWidgetFormInputHidden(),
  	'user_id'     => new sfWidgetFormInputHidden(),
  	'_csrf_token' => new sfWidgetFormInputHidden(),
  	'capcha_res'  => new sfWidgetFormInputHidden(),
		));

		$this->widgetSchema->setLabel('body','Текст комментария:');
		/*$this->widgetSchema->setLabel('captcha','Защита от спама:');*/
		$this->widgetSchema->setLabel('guest_name','Ваше имя:');


		/*$this->validatorSchema['captcha'] = new sfValidatorReCaptcha(array('private_key' => '6Lc2cLsSAAAAAJrkmHvZqWaA7nRUUupS-IsadYcj' ));*/
		$this->validatorSchema['body'] = new sfValidatorString(array('required'=>true, 'min_length'=>'1'), array('required'=>'Поле обязательно для ввода'));
		$this->validatorSchema['guest_name'] = new sfValidatorString(array('required' => true, 'max_length'=>'50'));

		$div = '<div style="font-size:18px;">';
		$this->validatorSchema['capcha_res'] = new sfValidatorString(array('required' => true, 'min_length'=>'3'), array('invalid'=>$div.'Защита от спама обязательна для ввода'.'</div>','min_length'=>$div.'Защина от спама не пройдена'.'</div>'));
	}
}
